export default function reducer(state = {
   serveType: [],
   addOK:null,
   changeOK:null,
   delOK:null
}, action) {
    switch (action.type) {
        case "initAllServeType":
            let newServeType = action.payload ? action.payload : []
            return {...state, serveType:[...newServeType],addOK:null,changeOK:null,delOK:null}
    
        case "initAddType":
                return {...state, addOK:action.payload}


         case "changeOneServeType":
                  return {...state, changeOK:action.payload}
        
         case "initDelType":
               return {...state, delOK:action.payload}

        default:
            return state
    }
}